package cn.sunline.dreamvalue.config;

import cn.sunline.adp.lite.model.manager.impl.AbstractFlowModelManager;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * @Description: 模型加载方式扩展
 * @Package: flow-demo
 * @email: Hacker_lsr@126.com
 * @author: lishirui
 **/
@Component
public class FlowModelManagerImpl extends AbstractFlowModelManager {
    /**
     * 默认资源查找路径
     */
    private static String flowResourcesClassPath = "classpath*:flow/**/*.xml";

    @Override
    public Object[] getFlowModelResouces() throws IOException {
        ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
        return resolver.getResources(flowResourcesClassPath);
    }
}
